package com.navinfo.tripanalysis.common.arithmetic;

import com.navinfo.tripanalysis.common.arithmetic.manager.AbstractArithmetic;
import com.navinfo.tripanalysis.common.arithmetic.common.OuterStatisticData;
import com.navinfo.tripanalysis.common.arithmetic.custom.VarCalcNumber;
import com.navinfo.tripanalysis.common.util.CommonUtils;

/**
 * 急转弯算法，根据0200状态位，来计算次数<br/>
 * 输出：统计<br/>
 */
public class SharpTurning extends AbstractArithmetic<VarCalcNumber> {
    @Override
    public void calculate() {
        // 当前点是否打开
        Boolean[] statusArr = new Boolean[]{CommonUtils.isStatusOpen(getCommonData().getSharpTurningStatus())};
        getObj().calc(statusArr);
    }


    @Override
    public void collect(OuterStatisticData statisticDataOut) {
        VarCalcNumber var = getObj().init(1);
        statisticDataOut.setSharpTurningNumber(var.getNumber()[0]);
        //不支持急转弯距离计算
        statisticDataOut.setSharpTurningMil(null);
    }
}
